<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        console.log([Promise]);

        const pro = new Promise((resolve, reject) => {
            console.log('邓哥向女神1发出表白短信');
            setTimeout(() => {
                if(Math.random() < 0.1) {
                    reject(true);
                }else{
                    reject(false);   //相当于 throw 了一个 false
                }
            }, 500);
        });

        console.log(pro);

        pro.catch(err => {
            console.log(err);
        })

    </script>
</body>
</html>